import request from '@/utils/request.js'

/**
 *  @param {Object} data -登录所需要的用户名称和密码
 */
export const loginApi = (data) => {
  return request.post('/driver/login/account', data)
}

export const profileApi = () => {
  return request.get('/driver/users')
}

// export const taskApi = (year, month) => {
//   console.log('接受年份御风', year, month);
//   return request.get('/driver/users/taskReport', null, {
//     params: { year, month }
//   })
// }

/**
 * 任务数据
 * @param {string} year - 任务数据的年份
 * @param {string} month - 任务数据的月份
 */
export const taskApi = (year, month) => {
  return request.get('/driver/users/taskReport', null, {
    params: { year, month }
  })
}

/**
 * 车辆信息
 */
export const truckApi = () => {
  return request.get('/driver/users/truck')
}